<?php
class Answer_Component_Block_Category extends Phpfox_Component
{
    public function process()
    {

        if (($this->request()->get('req3') == "category") && ($this->request()->get('req4'))) {
            $iCategoryId = $this->request()->get('req4');
        }
        else {
            $iCategoryId = 0;
        }
        if (Phpfox::getParam('answer.show_sub_category')) {
            $aCategories = Phpfox::getService('answer.category')->getForBrowse(0);
        }
        else {
            $aCategories = Phpfox::getService('answer.category')->getForBrowse($iCategoryId);
        }
        $this->template()->assign(array(
                'sHeader' => Phpfox::getPhrase('answer.categories'),
                'aCategories' => $aCategories,
                'iCategoryId' => $iCategoryId
            )
        );
        return 'block';
    }
}